#include "uerlogin.h"
#include "DataBase.h"
#include "ui_uerlogin.h"

uerlogin::uerlogin(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::uerlogin)
{
    ui->setupUi(this);
}


uerlogin::uerlogin(QString username,QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::uerlogin)
{
    ui->setupUi(this);
    this->username=username;
}

uerlogin::~uerlogin()
{
    delete ui;
}


void uerlogin::on_pushborrow_clicked()
{
    QString data = ui->borrownum->text();
    DataBase da;
    da.bookBorrow(username,data);
}


void uerlogin::on_pushbno_clicked()
{
    this->close();
}


void uerlogin::on_pushreturn_clicked()
{
    QString data = ui->borrownum->text();
    DataBase da;
    da.returnBook(username,data);
}


void uerlogin::on_pushrno_clicked()
{
    this->close();
}

